package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.SalesPlanDTO;
import com.lyf.scm.admin.api.dto.SalesPlanInfoDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description:
 *      需求计划
 * @author: haodong
 * @data: 2020/8/7 17:27
 */
@FeignClient(name = "scm-plan-service")
public interface SalesPlanRemote {

    /**
     * 按条件查询需求计划
     * @param demandPlan
     * @return
     */
    @PostMapping("/api/v1/salesPlan/listByWeek")
    Response<PageInfo<SalesPlanInfoDTO>> listWeekBySelective(@RequestBody SalesPlanDTO demandPlan);

    /**
     * 查询需求范围指标(范围)
     *
     * @param demandPlan 需求计划
     * @return {@link Response<List< SalesPlanInfoDTO >>}
     */
    @PostMapping("/api/v1/salesPlan/listAll")
    Response<List<SalesPlanInfoDTO>> listAllByCycles(@RequestBody SalesPlanDTO demandPlan);


    /**
     * 导出excel
     *
     * @param salesPlanDTO 销售计划dto
     * @param type          类型
     * @return {@link Response}
     */
    @PostMapping(value = "/api/v1/salesPlan/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response exportExcel(@RequestBody SalesPlanDTO salesPlanDTO, @RequestParam("type") Integer type);

    /**
     * 删除对应标识的数据
     *
     * @param opSign
     * @return
     */
    @PostMapping("/api/v1/demandPlan/delete")
    Response delete(@RequestParam("opSign") String opSign);
}
